package common

import (
	"encoding/json"
	uuid "go.uuid"
	"io/ioutil"
)

// 读取配置文件封装到对应结构体
func ReadJsonFile(filePath *string, v interface{}) error {
	data, err := ioutil.ReadFile(*filePath)
	if err != nil {
		return err
	}

	err = json.Unmarshal(data, v)
	if err != nil {
		return err
	}
	return nil
}

// 生成uuid
func GetUUID() string {
	UUID, _ := uuid.NewV4()
	return UUID.String()
}
